package com.swpu.project.model.page;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.Arrays;
import java.util.List;

public class RoleDto {

    String roleId;
    String roleName;
    @JsonIgnore
    String menuNames;
    List<String> menus;

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getMenuNames() {
        return menuNames;
    }

    public void setMenuNames(String menuNames)
    {
        this.menuNames = menuNames;
       if(StrUtil.isBlank(menuNames))
           return;
        String[] split = menuNames.split(",");
      this.menus = Arrays.asList(split);


    }

    public List<String> getMenus() {
        return menus;
    }

    public void setMenus(List<String> menus) {
        this.menus = menus;
    }
}
